const { defineConfig } = require('@vue/cli-service')
const webpack = require('webpack');
const { ElementPlusResolver } = require('unplugin-vue-components/resolvers')
module.exports = defineConfig({
  transpileDependencies: true,
  lintOnSave: false,
  outputDir: 'dist',
  publicPath: './',
  configureWebpack:{
    resolve: {
      fallback: {
        "crypto": require.resolve("crypto-browserify"),
        "stream": require.resolve("stream-browserify"),
        "vm": require.resolve("vm-browserify")
      }
    },
    plugins:[
      new webpack.ProvidePlugin({
        process: 'process/browser',
      }),
      require('unplugin-vue-components/webpack').default({
        dts: 'types/auto-components.d.ts',
        resolvers:[ElementPlusResolver()] 
      }),
      require('unplugin-auto-import/webpack').default({
        dts: 'types/auto-imports.d.ts',
        imports: [
          'vue',
          'vue-router',
          'vuex', 
        ],
        dirs: [ 
          'src/utils', 
        ],
        resolvers:[ElementPlusResolver()]
      })

    ],

  },
 devServer:{
  port: 7534
 }

})
